﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace TestWPFVideo
{
    /// <summary>
    /// Window1.xaml 的交互逻辑
    /// </summary>
    public partial class Window1 : Window
    {
        VideoSDK.VideoSDKHC video = new VideoSDK.VideoSDKHC();
        public Window1()
        {
            InitializeComponent();
        }
        protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
        {
            if (video.IsLogined)
            {
                video.CloseVideo();
                video.LogoutEncoder();
            }

            base.OnClosing(e);
        }
        private void bOpen_Click(object sender, RoutedEventArgs e)
        {
            bool ret = video.LoginEncoder("192.168.1.188", 8000, "admin", "12345");
            //IntPtr handle = new WindowInteropHelper(this).Handle;
            ret = video.OpenVideo(1, pBVideo.Handle);
        }
    }
}
